1. Field of the Invention
The present invention relates to an image data encoding technique.
2. Description of the Related Art
A fixed-length-encoded image is very convenient for image editing such as rotation. However, a fixed-length-encoded image generally has a data size larger than that of a variable-length-encoded image. When storing an image in a hard disk or the like, therefore, it is disadvantageous to perform fixed length encoding on the image from the viewpoint of the volume. Accordingly, a method of further performing variable length encoding on a fixed-length-encoded image has been developed.
For example, Japanese Patent Laid-Open No. 2002-094801 discloses a method which, if the same fixed-length-encoded data continues, performs variable length encoding by encoding the number of times of repetition of the fixed-length-encoded data. Also, Japanese Patent Laid-Open No. 2001-094985 discloses a method of allocating a predetermined number of bits to each frequency component of an image, and further performing entropy encoding.
Unfortunately, an image is sometimes encoded by using two or more fixed length encoding methods. For example, Japanese Patent Laid-Open No. 2008-278042 discloses a method of dividing an image into a plurality of regions, and performing fixed length encoding on each region by using a selected fixed length encoding method. In encoded image data made up of two or more kinds of fixed length codes as described above, the possibility that the same fixed-length-encoded data continues is low. Accordingly, the effect of compression is presumably low even when using the method of Japanese Patent Laid-Open No. 2002-094801. Also, different kinds of fixed length codes have different bit assignments. When using the method of Japanese Patent Laid-Open No. 2001-094985, therefore, not only the extraction of each component is complicated, but also the statistical properties are different. This may make it impossible to increase the compression rate.